from behave import *

import Utils as Utils
import page_object.HealthInsurance.HealthInsuranceProductPage as HealthInsuranceProductPage
import page_object.HomePage as HomePage


@step("被保人为{age}岁")
def step_impl(context, age):
    HealthInsuranceProductPage.input_textbox(context).send_keys(age)
    HomePage.submit_button(context).click()


@step("客户可知悉需要为其缴纳{total_amount}元的投保费用")
def step_impl(context, total_amount):
    Utils.assert_with(context, total_amount)


@step("会抛出异常，并提示“{err_msg}”")
def step_impl(context, err_msg):
    Utils.assert_with(context, err_msg)
